home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dr. Windows 3
/
dr win3.zip
/
dr win3
/
PROGRAMR
/
FOYEH201.ZIP
/
FOYEH1.INT
< prev
next >
Wrap
Text File
|
1993-10-04
|
23KB
|
727 lines
{*** TURBO PASCAL UNIT: INTERFACE TO FOYEH1.DLL **}
{*** Released into the public domain by Dr. A. Olowofoyeku **}
{*** If anyone can convert this into a C/C++ HEADER file **}
{*** please do so, and please send me a copy of the header **}
{*** file. **}
{*** The Dynamic Link Library FOYEH1.DLL is supplied with **}
{*** many of my Windows and Win-OS/2 programs. I am constantly **}
{*** developing and updating it. If you have any problems or **}
{*** discover any bugs while using it with your own programs **}
{*** please mail me, and I will try and fix it. NOTE however **}
{*** that I do not make any warranties concerning FOYEH1.DLL **}
{*** or this interface UNIT to it. Everybody uses both of them **}
{*** at their own risk. The DLL itself is already widely **}
{*** available. I am only releasing the interface to it, so **}
{*** that others may benefit from some of its routines. **}
{*** NOTE: that some of the routines in the DLL require the **}
{*** presence of Borland's BWCC.DLL. If you are a TPW/BP7 user **}
{*** you already have this DLL. However, most of the routines **}
{*** do not require BWCC.DLL. You can normally tell from the **}
{*** name of the routine whether it uses any call from BWCC.DLL **}
{*** Note also, that if you have an old version of FOYEH1.DLL **}
{*** then some of the routines may not be available. **}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{ Dr. A. Olowofoyeku }
{ 268 Horwood }
{ Newcastle }
{ Staffs ST5 5BQ, }
{ England. }
{ }
{ E-mail:laa12@seq1.keele.ac.uk }
{ }
{ October 1993. }
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{-----------------------------------------------------------------------}
THIS FILE PROVIDES A DESCRIPTION OF THE ROUTINES IN THE INTERFACE
SECTION OF THE UNIT "FOYEH1.PAS", A TURBO/BORLAND PASCAL TO MY
DYNAMIC LINK LIBRARY, "FOYEH1.DLL".
ALL THE FOUR FILES (i.e., FOYEH1.DLL, FOYEH1.PAS, FOYEH1.INT, AND
FOYEH1.SUM) MUST BE INCLUDED IN ANY DISTRIBUTION.
{-----------------------------------------------------------------------}
FOYEH1.DLL was compiled with the following compiler directives;
{$S-,R-,V-,I-,B-,F+,G+}
USES
Wintypes;
{** new data types used in the DLL ***}
Type
String79 = String[79];
StringArray = Array[1..20] of String79;
{** Routines in the DLL ***}
{-----------------------------------------------------------------------}
Function DllVersion : Word;
{** Returns the version number of the current copy of FOYEH1.DLL **}
{-----------------------------------------------------------------------}
Function GetS(Prompt : String) : String;
{**
Get a string from the keyboard. PROMPT is a string that prompts
the user for input. This function uses the ReadKey() function from
the WINCRT unit, and allows you to exit by pressing ESCape
e.g. MyName := GetS('Type in your name : ');
Note: do not use this function in an OWL program. It is only
useful for programs using the WINCRT unit's simulated windows.
**}
{-----------------------------------------------------------------------}
Function ShowDir : String79;
{** Returns the current directory **}
e.g.
CurrentDir := ShowDir;
{-----------------------------------------------------------------------}
Procedure ErrorMessage(Caption, Msg : PChar);
{**
This is a shell to the MessageBox API call. It allows you to just
type in your message and its caption. The dialog box produced has
an OK button only.
e.g.
ErrorMessage('ERROR','File not found!');
**}
{-----------------------------------------------------------------------}
Procedure BWCCErrorMessage(Caption, Msg : PChar; Extra : Word);
{**
Same as ErrorMessage (above) but differs in two respects. It calls
the MessageBox in BWCC.DLL instead of the one in the Windows API,
and it allows you to specify, in "EXTRA", other messagebox attributes.
e.g. BWCCErrorMessage('ERROR','File not found!', 0);
BWCCErrorMessage('ERROR','File not found!', mb_IconExclamation);
**}
{-----------------------------------------------------------------------}
Procedure ModalMessageBox(Caption, Msg : PChar);
{**
Produces a modal message box. The user cannot do anything else until
the messagebox is removed (by clicking on the OK button, or by
pressing <ENTER>
**}
{-----------------------------------------------------------------------}
Function Confirm(Caption, Msg : PChar) : Boolean;
{**
Allows you to answer "YES" or "NO" to the message in "MSG". If
you click on the YES button, the function returns TRUE, else it
returns FALSE.
e.g. If Confirm('Exit!','Sure you want to Exit?') then QUIT;
**}
{-----------------------------------------------------------------------}
Function BwccConfirm(Caption, Msg : PChar) : Boolean;
{**
Same as CONFIRM() above, but uses the BWCC.DLL message box.
**}
{---------------------------------------------------------------------}
Function ConfirmModal(Caption,Msg : PChar) : Boolean;
{**
Same as CONFIRM() above, but uses a modal Windows message box.
**}
{-----------------------------------------------------------------------}
Function ExistOnPath(FName : String79; Var Dest : String79) : Boolean;
{**
Does a file exist in the DOS path? Returns TRUE if the file FNAME
is found in a directory which is in the DOS path. In this case, the
full pathname of the file is returned in DEST.
e.g. If NOT ExistOnPath('WRITE.EXE', MyExec) then
ErrorMessage('ERROR','I cannot find WRITE.EXE');
**}
{-----------------------------------------------------------------------}
Function Exist(Var Fname : String79) : Boolean;
{**
Does FNAME exist in the CURRENT directory? If so, returns TRUE,
and returns the full pathname of the file.
e.g.
If Not Exist('MYPROG.HLP') then
ErrorMessage('ERROR','MYPROG.HLP is required in this directory!');
**}
{-----------------------------------------------------------------------}
Function FSize(FName : String79) : LongInt;
{**
Returns the size (in bytes) of the FNAME. If the file does not
exist, returns ZERO.
e.g.
Var
Size : Longint;
begin
Size := FSize('TPW.HLP');
end;
**}
{-----------------------------------------------------------------------}
Function HasWildCards(s : String) : Boolean;
{**
Does the string "S" have wildcard characters? Wildcard characters
here are "*", and "?"
**}
{-----------------------------------------------------------------------}
Function IsDirectory(var MyDir : string79): Boolean;
{**
Is MYDIR a valid sub-directory? If so, returns TRUE, and returns the
full pathname in MYDIR.
e.g.
Var
MyDir : String79;
begin
MyDir := 'Z:\TPW\PROGRAMS';
If Not IsDirectory(MyDir)
then writeln('You have specified an invalid directory!');
end;
**}
{-----------------------------------------------------------------------}
Function IsCommand(Command : String79) : String79;
{**
Is "COMMAND" a valid executable file? Is so, returns the full
path name of the file. Valid executables for this purpose are
those with the extension COM, EXE, BAT, and PIF.
If COMMAND does not have any extension, the function will append
each of the the above extensions to it, and try to locate a file
of that name in the DOS path. If no file is not found in the DOS
path, the funct